<template>
  <ul class="todo-main">
    <Item v-for="item in todoList" :key="item.id" v-bind="item" />
  </ul>
</template>

<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  name: "List",
});
</script>

<script setup lang="ts">
import Item from "./components/Item/index.vue";
import type { TodosType } from "../../App.vue";
//接收props的方法1
/* const props = defineProps(["todoList"]);
console.log(props); */

//接收props的方法2
interface propsType {
  todoList: TodosType;
}

const props = defineProps<propsType>();
console.log(props);
</script>

<style scoped>
.todo-main {
  margin-left: 0px;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding: 0px;
}

.todo-empty {
  height: 40px;
  line-height: 40px;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding-left: 5px;
  margin-top: 10px;
}
</style>
